package com.lp.gps_alarm_tests;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

import com.lp.gps_alarm_classes.Poi;

public class PoiTest {
	
	private Poi poi;	// es wird kein Wert gesetzt => default-Werte
	private Poi poi2;	// keine default-Werte

	@Before
	public void setUp() throws Exception {
		poi = new Poi();
		poi2 = new Poi();
		poi2.setDescription("Kamerun");
		poi2.setRadius(3.14);
		poi2.setxDestinationCoordinate(3.0);
		poi2.setyDestinationCoordinate(11.0);
	}

	@Test
	public void testPoi() {
		Poi testPoi = new Poi();
		assertNotNull(testPoi);
		assertEquals("default", testPoi.getDescription());
		assertEquals(5.0, testPoi.getRadius(), 0);
		assertEquals(47.668025, testPoi.getxDestinationCoordinate(), 0);
		assertEquals(9.170988, testPoi.getyDestinationCoordinate(), 0);
	}

	@Test
	public void testGetDescription() {
		assertEquals("default", poi.getDescription());
		assertEquals("Kamerun", poi2.getDescription());
	}

	@Test
	public void testSetDescription() {
		poi2.setDescription("blabla");
		assertEquals("blabla", poi2.getDescription());
	}

	@Test
	public void testGetxDestinationCoordinate() {
		assertEquals(47.668025, poi.getxDestinationCoordinate(), 0);
		assertEquals(3.0, poi2.getxDestinationCoordinate(), 0);
	}

	@Test
	public void testSetxDestinationCoordinate() {
		poi2.setxDestinationCoordinate(55.66);
		assertEquals(55.66, poi2.getxDestinationCoordinate(), 0);
	}

	@Test
	public void testGetyDestinationCoordinate() {
		assertEquals(9.170988, poi.getyDestinationCoordinate(), 0);
		assertEquals(11.0, poi2.getyDestinationCoordinate(), 0);
	}

	@Test
	public void testSetyDestinationCoordinate() {
		poi2.setyDestinationCoordinate(22.11);
		assertEquals(22.11, poi2.getyDestinationCoordinate(), 0);
	}

	@Test
	public void testGetRadius() {
		assertEquals(5.0, poi.getRadius(), 0);
		assertEquals(3.14, poi2.getRadius(), 0);
	}

	@Test
	public void testSetRadius() {
		poi2.setRadius(123.0);
		assertEquals(123.0, poi2.getRadius(), 0);
	}

}
